/**
 *
 * @type jQuery
 *
 * @name systemCommon
 *
 * @cat systemCommon
 *
 * @author com.sn@Liaobj
 */

////for check Cursor
/**
 *
 * @description Create a sortable table with multi-column sorting capabilitys
 *
 * @example
 *
 * <s:textfield id="patbasic_kanalastname"name="patbasic.kanalastname" />
 *
 * <span id="error_patbasic_kanalastname"
 *       class="fielderror" >
 *     <s:fielderror
 *       fieldName="patbasic.kanalastname">
 *     </s:fielderror>
 * </span>
 *
 */
$(document).ready(function()
{
	if($('.fielderror').size()>0){
		$('#'+$('.fielderror').first().attr("id").substring(6)+'').focus();

		$('.fielderror').each(function() {
			if($(this).html()!=""){
				$('#'+$(this).attr("id").substring(6)).focus();
				return false;
			}
		});
	}

	$('input:text ,select').keydown(function(){if(event.keyCode==13){event.keyCode='9';}});

//	$('input:text ,select,textarea').focus(function(){
//		$(this).css({background: "#fe7671"});
//	});
//
//	$('input:text ,select,textarea').blur(function(){
//		$(this).css({background: "#000"});
//	});


//	$('#'+$(this).attr("id").substring(12)).focus(function(){
//		$($("#"+pid)).css({background: "#fe7671"});
//    });
//
//	$('#'+$(this).attr("id").substring(12)).blur(function(){
//		$($("#"+pid)).css({background: "none"});
//	});
});
